package cn.itheima.health.demo;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.FileInputStream;
import java.io.IOException;

public class POIDemo {

    public static void main(String[] args) {
            //  解析excel    HssF    XSSF
        try {
            XSSFWorkbook xssfWorkbook = new XSSFWorkbook(
                    new FileInputStream("C:\\Users\\tps\\Desktop\\项目-唐\\传智健康Day05-后台-预约管理\\资料\\hello.xlsx"));

            XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
           //   循环每一行
            for (Row row : sheet) {

                for (Cell cell : row) {

                    System.out.println(cell.getStringCellValue());

                }


            }


        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
